-- card: 9208 from stack: in.6 -- bmap block id: 0 -- flags: 0000 -- background id: 3411 -- name: Auxiliary X-Commands ----- HyperTalk script ----- on turnOn buttonNo lock screen hide cd fld "Info" hide bg fld "theResult" repeat with counter = 1 to 4 if buttonNo = counter then set the hilite of cd btn counter to TRUE show bg fld counter else set the hilite of cd btn counter to FALSE hide bg fld counter end if end repeat set scroll of bg fld buttonNo to 0 show bg btn "Close Information" unlock screen with visual effect dissolve end turnOn on closeall set cursor to watch lock screen repeat with x = 1 to 4 hide bg fld x set hilite of cd btn x to FALSE end repeat hide bg btn "Close Information" show cd fld "info" show bg fld "theResult" unlock screen with visual effect dissolve end closeall on closecard closeall end closecard on printIt put bg fld 1 & return & bg fld 2 & return & bg fld 3 & return & bg fld 4 into container put bg fld "Title" into prompt PrintDoc prompt,container,prompt,times,12 end printIt -- part 2 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=90 right=112 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: PrintDoc XCMD ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 3 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=120 right=142 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ClipToPICT XFCN ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 4 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=150 right=172 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Ants XFCN ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 5 (button) -- low flags: 00 -- high flags: A004 -- rect: left=17 top=180 right=202 bottom=194 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ColorOn XFCN ----- HyperTalk script ----- on mouseUp if the visible of bg fld (the number of me) then closeall else put the number of me into displayinfo turnOn displayinfo end if end mouseUp -- part 6 (field) -- low flags: 01 -- high flags: 2000 -- rect: left=124 top=50 right=83 bottom=391 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: Info -- part 7 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=11 top=4 right=64 bottom=78 -- title width / last selected line: 0 -- icon id / first selected line: 529 / 529 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: SD -- part contents for background part 21 ----- text ----- Auxiliary X-Commands -- part contents for background part 31 ----- text ----- ColorOn XFCN 1.0 ©Copyright 1988 by Jay Hodgdon on mouseUp put ColorOn() into theMode if theMode is TRUE then doColorThing else doBWThing end mouseUp ColorOn XFCN returns TRUE if the monitor is currently in color mode and FALSE if it is in monochrome. It first checks to see if color QuickDraw is supported. If color QuickDraw is present, it then quizzes the graphics device for its color/monochrome setting. If you use this XFCN on a Macintosh containing a non-standard color graphics device (such as the Mac SE Orchard card) it will still return a value of FALSE because true color QuickDraw is not being used. If you use this XFCN in a multiple screen environment it will return TRUE if ANY of the graphics devices is displaying color. See the script of the "Who did this?" button on card 1 for a demo of this XFCN. • Click here to go there now. • -- part contents for background part 15 ----- text ----- PrintDoc XCMD 1.03 ©Copyright 1988,1989 by Jay Hodgdon PrintDoc XCMD prints the contents of a field or variable (up to 32K) in your choice of font and size. Pages will be numbered and contain a centered header at the top. A print-cancel box is presented, allowing the user to cancel the print job. The parameters of PrintDoc XCMD are: PrintDoc
,,,, where
is a string that will appear at the top of each printed page; is a field or variable that contains what will be printed; is a string that will appear in the "print cancel" dialog and in the long narrow LaserWriter status dialog; is the font that will be printed in; is the font size. If the specified font is missing, Geneva will be substituted. The header that is printed on each page will be in Times 12. It will be centered on the page. Each page will be numbered (at the bottom center) in Times 12. The print set-up (not the PAGE set-up) dialog will be presented. If the user clicks Cancel the result returned by the XCMD will be "Print job canceled." If the user clicks OK a dialog will appear that will contain in the string "Printing " and "Type command-. to Cancel." The first string will ALWAYS be centered within the dialog, regardless of the length of (unless it overruns the width of the box). This dialog will be centered on the screen (NOT on the card window), just below where the laserwriter status dialog is displayed. If the user types Command-period during printing, the print job will be cancelled and the cancel dialog will be dismissed. The result will be empty. If the print job is successful the result will be empty. Error codes returned in the result are: Error: There is nothing to print! Error: Can only print 32000 characters at a time! If you don't wish to have the cancel dialog displayed, omit the DLOG/DITL resources (ID 5100) from your stack. I recommend that you use it. (You cannot renumber these resources.) Revision history: Version 1.03 4/2/89 has better error handling for situations where the LaserWriter is turned off when trying to print or when the "printing" files are missing from the System Folder. It also fixes a gross bug where the XCMD would crash the machine if the printing DLOG/DITLs were missing from the stack. -- part contents for background part 17 ----- text ----- ClipToPICT XFCN 1.2 ©Copyright 1988,1989 by Jay Hodgdon ClipToPICT XFCN converts whatever picture is on the clipboard into a PICT resource and places it in the current stack, any other stack, or into a new file (that is "double-clickable" by ResEdit). The parameters of ClipToPICT XFCN are: ClipToPICT(,, ) where: is the resource ID number for the new PICT; is the name of the new PICT resource; specifies if the PICT is to be inserted into the current stack, any other stack, or into a new file. This parameter must be "this", "other", or "file". If the parameter is: "this" then the PICT is inserted into the current stack. "other" then the PICT is inserted into another stack. The standard file box is displayed for selection of the stack. "file" then the standard file box is displayed allowing you to create a new file that will contain the PICT resource. This file is "double-clickable" by ResEdit. If you pass "0" (that's a zero) as the first parameter, ClipToPICT will assign its own unique ID to the new resource. If you leave the second parameter empty (that doesn't mean that you can OMIT the second parameter) then the new PICT will be unnamed. If everything goes alright, the ID of the new PICT resource will be returned by the function. If something goes wrong the following errors are returned: Form: ClipToPICT(,,) Error: That PICT resource ID already exists! Error: That PICT name already exists! Error: There isn't a picture on the clipboard! Error: Unable to open the stack! Any disk related errors will be reported by: Error: Resource not found Error: Resource file not found Error: ClipToPICT failed to add resource Error: RmveResource failed Error: Attribute does not permit operation Error: Map does not permit operation Error: Disk is full Error: Disk is locked Error: File is locked or other nonspecific errors in the form: Error: where is one of the standard Macintosh operating system error codes. As you can deduce from the error messages, ClipToPICT will not write over a previously existing PICT resource if it has the same ID or name as the new one. If there isn't anything on the clipboard (or there is text), ClipToPICT will exit (with a beep) without creating a resource. See the script of PICT Maker for a demo of the XCMD. • Click here to go there now. • Revision history: 1.0 initial release 1.11 12/22/88 The newly created PICT resource is made purgeable. 1.2 5/5/89 Rewrote ClipToPICT so that it can insert a newly created PICT into any other stack, or a new file, in addition to the current stack. -- part contents for background part 18 ----- text ----- Ants XFCN 1.2 ©Copyright 1988,1989 by Jay Hodgdon Ants XFCN returns the coordinates of a rectangle drawn out with the mouse. When Ants is "active" it changes the cursor into the cross-hair. Then when the user clicks the mouse, a marquee-style rectangle will be drawn out on the screen. on mouseUp put Ants() into theRect end mouseUp Ants XFCN produces one error message: Error: Not enough momory to make bitmap. It will beep if this happens. See the script of PICT Maker for a demo of this XFCN. • Click here to go there now. • Revision history: 1.0 11/13/88 Ants draws a rectangle on the screen, but don't march! 1.1 12/17/88 Made the Ants march. 1.2 5/10/89 Converted Ants to an offscreen bitmap and used CopyBits to eliminate screen flicker when drawing the rectangle. Ants now also forces the event queue to be flushed so that the mouseclick that draws out the rectangle isn't passed along to HyperCard. -- part contents for background part 30 ----- text ----- 22 -- part contents for card part 6 ----- text ----- These X-commands were used in the preparation of this stack, and are part of the ShowDialog "package."